<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "contact".
 *
 * @property integer $id
 * @property string $username
 * @property string $phone
 * @property string $content
 * @property string $ctime
 */
class Contact extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'contact';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username'], 'required', 'message' => '请您输入姓名'],
            [['phone'], 'required', 'message' => '请您输入联系方式'],
            [['content'], 'required', 'message' => '请您输入需求详细信息'],
            [['ctime'], 'safe'],
            [['username', 'phone'], 'string', 'max' => 100],
            [['content'], 'string', 'max' => 1000],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'phone' => 'Phone',
            'content' => 'Content',
            'ctime' => 'Ctime',
        ];
    }
}
